﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>标签管理</title>
        $css()
	    ${css}
	</head>
	<body>
    <!--

    //
    // Copyright 2011 @ OPSoft INC,All rights reseved.
    // Project : 奥博网站管理系统
    // Name : 标签组件
    // Author : Newmin (newmin.net@gmail.com)
    // Create : 2011/08/28 16:27
    // Product Link: http://www.ops.cc
    //

    -->


        <h1>标签管理</h1>
        <form action="" method="post" target="tag_ifr" enctype="application/x-www-form-urlencoded">

        <input type="hidden" name="tag.action" id="action"/>

        <table cellspacing="1" cellpadding="0" class="ui-table ui-table-padding">
         <tr>
            <th style="width:30px">&nbsp;</th>
            <th style="width:80px">名称</th>
            <th>链接地址</th>
            <th>描述</th>
            <th style="width:50px">&nbsp;</th>
         </tr>

         <tr>
            <td>&nbsp;</td>
            <td><input name="name" /></td>
            <td><input name="linkuri" /></td>
            <td><input name="description" /></td>
            <td class="center"><a style="color:red" href="javascript:submitFORM('create')">新增</a></td>
         </tr>

         ${tagsHtml}

        </table>


        <div class="control">
        <input class="button" type="button" value="保存" onclick="return submitFORM('save')"/>&nbsp;&nbsp;&nbsp;
        <input class="button" type="button" value="删除" onclick="return submitFORM('delete')" />

        <div class="pager" class="hidden" style="display:none">
            分页：${pagetext}
        </div>
        
        </div>

        
        </form>
        
        <iframe name="tag_ifr"></iframe>
        
        $js()
    <script type="text/javascript">

        cms.table.dynamic(document.getElementsByTagName("table")[0]);

        var trs = document.getElementsByTagName("tr");
        var act = document.getElementById("action");

        function edit(t) {
            var pnode = t.parentNode.parentNode,
                tds = pnode.getElementsByTagName('td');

            var id = tds[0].childNodes[0].getAttribute('indent');
            if (tds[1].getElementsByTagName('input').length == 0) {
                tds[1].innerHTML = '<input name="name_' + id + '" value="' + tds[1].innerHTML + '"/>';
            }
            if (tds[2].getElementsByTagName('input').length == 0) {
                tds[2].innerHTML = '<input name="link_' + id + '" value="' + tds[2].innerHTML + '"/>';
            }
            if (tds[3].getElementsByTagName('input').length == 0) {
                tds[3].innerHTML = '<input name="des_' + id + '" value="' + tds[3].innerHTML + '"/>';
            }
        }

        function submitFORM(_act) {

            act.value = _act;
            showDialog();
            document.forms[0].submit();

        }


        function showDialog() {
            dialog = document.createElement("div"),
	          dialog2 = document.createElement("div");

            dialog.setAttribute('id', 'dialog');
            dialog2.setAttribute('id', 'dialog2');

            var x = document.body.scrollWidth,
	              y = document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight;

            dialog2.innerHTML = '处理中...';


            document.body.appendChild(dialog);
            document.body.appendChild(dialog2);

            dialog.style.cssText = 'position:absolute;z-index:9;top:0;left:0;width:' + x + 'px;height:' + y + 'px;filter:alpha(opacity=20);opacity:0.2;background:#fff;';
            dialog2.style.cssText = 'position:absolute;top:' + ((document.body.offsetHeight - 60) / 2) + 'px;left:' + (x - 250) / 2 + 'px;width:250px;line-height:20px;padding:20px 0;z-index:10;filter:alpha(opacity=100);opacity:1;border:solid 1px #006699;background:white;text-align:center;color:red';

        }
        function closeDialog() {
            document.body.removeChild(dialog);
            document.body.removeChild(dialog2);
        }

        /* 服务端回传消息 */
        function tip(msg) {
            dialog2.innerHTML = msg;
            setTimeout(msg.indexOf("成功") == -1 ? closeDialog : function () { location.href = location.search; }, 2000);
        }
        function invoke_compelete(msg) {

            dialog2.innerHTML = (msg != '' ? msg + '<br />' : '') + '恭喜采集完成!&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:closeDialog()">继续采集</a>';

        }
    
    </script>

	</body>
</html>